package com.example.qytw.qytw;

import com.alibaba.dashscope.aigc.generation.Generation;
import com.alibaba.dashscope.aigc.generation.GenerationParam;
import com.alibaba.dashscope.aigc.generation.GenerationResult;
import com.alibaba.dashscope.common.Message;
import com.alibaba.dashscope.common.Role;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.Constants;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import lombok.Getter;
import org.apache.poi.sl.usermodel.Sheet;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ApplicationContext;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * -----------------------------
 * PackageName： com.example.qytw.qytw
 * ClassName：Qytw
 * Description：
 *
 * @author：it-yml CreateTime：2024-09-29
 * -----------------------------
 */
public class Qytw {

    private static ApplicationContext applicationContext;


    public static void main(String[] args) {
        File file = new File("/Users/apple/work/chao-text/ttt");
        File[] tempList = file.listFiles();
        for (File temp : tempList) {
            if (temp.isFile() && (temp.getName().endsWith(".xlsx") || temp.getName().endsWith(".xls"))) {
                String absolutePath = temp.getAbsolutePath();
                System.out.println(absolutePath);
                DemoDataListener demoDataListener = new DemoDataListener();
                EasyExcel.read(absolutePath, ExcelMode.class, demoDataListener).sheet().doRead();
            }

        }


    }


}
